package pl.edu.pk.mech.kkbus.service;

import static pl.edu.pk.mech.kkbus.staticstrings.NameEntity.NAME_ENTITY_REFUELING;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import pl.edu.pk.mech.kkbus.model.Refueling;
import pl.edu.pk.mech.kkbus.repository.RefuelingDAO;

public class RefuelingService {
    @Autowired
    RefuelingDAO refuelingDAO;
    
    public boolean createOrUpdateRefueling(Refueling refueling) {
    	return refuelingDAO.createOrUpdate(refueling, NAME_ENTITY_REFUELING, refuelingDAO);
    }
    
    public List<Refueling> getAllRefuelings() {
        return refuelingDAO.getAllRefueling();
    }  
    
    public Refueling getRefueling(long id){
    	return refuelingDAO.getRefueling(id);
    }
    
    public List<Refueling> getRefuelingsByIdBus(String idBus) {
        return refuelingDAO.getRefuelingByIdBus(idBus);
    }  
}
